﻿using System;
using System.Net.Sockets;

namespace FemtoHttpd
{
    public class FemtoHttpListener
    {
        private TcpListener _listener;
        public FemtoHttpListener(TcpListener listener)
        {
            this._listener = listener;
        }

        public FemtoHttpContext GetContext()
        {
            return new FemtoHttpContext(_listener.AcceptTcpClient());
        }

        public void Start()
        {
            _listener?.Start();
        }
        public void Stop()
        {
            _listener?.Stop();
        }
    }
}
